home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / RKMLibsPrgs / samplelibrary / sampleinclude / asmsupp.i next >
Text File  |  1992-09-03  |  3KB  |  80 lines

  1. * asmsupp.i
  2. *
  3. ********************************************************************************************
  4. *assorted low level assembly support routines used by the Commodore sample Library & Device
  5. *******************************************************************************************
  6. *
  7. *
  8. * Copyright (c) 1992 Commodore-Amiga, Inc.
  9. *
  10. * This example is provided in electronic form by Commodore-Amiga, Inc. for
  11. * use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  12. * published by Addison-Wesley (ISBN 0-201-56774-1).
  13. *
  14. * The "Amiga ROM Kernel Reference Manual: Libraries" contains additional
  15. * information on the correct usage of the techniques and operating system
  16. * functions presented in these examples.  The source and executable code
  17. * of these examples may only be distributed in free electronic form, via
  18. * bulletin board or as part of a fully non-commercial and freely
  19. * redistributable diskette.  Both the source and executable code (including
  20. * comments) must be included, without modification, in any copy.  This
  21. * example may not be published in printed form or distributed with any
  22. * commercial product.  However, the programming techniques and support
  23. * routines set forth in these examples may be used in the development
  24. * of original executable software products for Commodore Amiga computers.
  25. *
  26. * All other rights reserved.
  27. *
  28. * This example is provided "as-is" and is subject to change; no
  29. * warranties are made.  All use is at your own risk. No liability or
  30. * responsibility is assumed.
  31.  
  32. CLEAR   MACRO           ;quick way to clear a D register on 68000
  33.         MOVEQ   #0,\1
  34.         ENDM
  35.  
  36. LINKSYS MACRO           ; link to a library without having to see a _LVO
  37.         MOVE.L  A6,-(SP)
  38.         MOVE.L  \2,A6
  39.         JSR     _LVO\1(A6)
  40.         MOVE.L  (SP)+,A6
  41.         ENDM
  42.  
  43. CALLSYS MACRO           ; call a library via A6 without having to see _LVO
  44.         JSR     _LVO\1(A6)
  45.         ENDM
  46.  
  47. XLIB    MACRO           ; define a library reference without the _LVO
  48.         XREF    _LVO\1
  49.         ENDM
  50. ;
  51. ; Put a message to the serial port at 9600 baud.  Used as so:
  52. ;
  53. ;     PUTMSG   30,<'%s/Init: called'>
  54. ;
  55. ; Parameters can be printed out by pushing them on the stack and
  56. ; adding the appropriate C printf-style % formatting commands.
  57. ;
  58.                 XREF    KPutFmt
  59. PUTMSG:         MACRO   * level,msg
  60.  
  61.                 IFGE    INFO_LEVEL-\1
  62.  
  63.                 PEA     subSysName(PC)
  64.                 MOVEM.L A0/A1/D0/D1,-(SP)
  65.                 LEA     msg\@(pc),A0    ;Point to static format string
  66.                 LEA     4*4(SP),A1      ;Point to args
  67.                 JSR     KPutFmt
  68.                 MOVEM.L (SP)+,D0/D1/A0/A1
  69.                 ADDQ.L  #4,SP
  70.                 BRA.S   end\@
  71.  
  72. msg\@           DC.B    \2
  73.                 DC.B    10
  74.                 DC.B    0
  75.                 DS.W    0
  76. end\@
  77.                 ENDC
  78.                 ENDM
  79.  
  80.